Embodiments described herein relate generally to hash functions, and, in particular, to a hash function configured to define a hash value based on predefined vectors.
A hash function is a procedure or mathematical function configured to calculate a hash value based on a hash key. In some instances, the hash key can be defined based on a portion of data parsed from input data. The hash value that can be used to retrieve information in a table/database or to compare data (e.g., input data). For example, a hash function can be used to detect duplicate records in a file, to find similar or matching deoxyribonucleic acid (DNA) sequences, to identify policies associated with Internet Protocol (IP) address prefixes, and so forth.
Many known hash functions, however, produce an unacceptable level of duplicate hash values (referred to as collisions) based on unique input data. In addition, many known hash functions produce unacceptably non-uniform distributions of hash values based on an input data set. Finally, many known hash functions that are simple to execute in software are too slow and/or cannot be efficiently implemented in hardware. Thus, a need exists for methods and apparatus to address at least some of the undesirable attributes of known hash functions.